package com.aopdemo.service;

// 确保添加这个导入语句
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    @Override
    public void add(String productName, int quantity) {
        System.out.println("已添加商品: " + productName + ", 数量: " + quantity);
    }

    @Override
    public void delete(String productName) {
        System.out.println("已删除商品: " + productName);
    }

    @Override
    public int find(String productName) {
        int count = (int)(Math.random() * 10) + 1; // 模拟查询结果
        System.out.println("查询到商品 [" + productName + "] 的数量: " + count);
        return count;
    }
}
